package com.tailyou.hms.neteasecloudmusic;

import android.graphics.Color;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.AbsoluteSizeSpan;
import android.text.style.ForegroundColorSpan;
import android.widget.ListView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import java.util.ArrayList;

public class LovedMusicActivity extends AppCompatActivity {

    private MusicAdapter adapter;
    public static ArrayList<MusicBean> listData;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_loved_music);
        TextView tvVipMusic = findViewById(R.id.tvVipMusic);
        SpannableStringBuilder style1 = new SpannableStringBuilder("含5首VIP专属歌曲");
        style1.setSpan(new ForegroundColorSpan(Color.parseColor("#3B6DAA")), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        tvVipMusic.setText(style1);

        TextView tvPlayAll = findViewById(R.id.tvPlayAll);
        SpannableStringBuilder style2 = new SpannableStringBuilder("播放全部（8）");
        style2.setSpan(new ForegroundColorSpan(Color.parseColor("#999999")), 4, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        style2.setSpan(new AbsoluteSizeSpan(36), 4, 7, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        tvPlayAll.setText(style2);

        listData = new ArrayList<>();
        listData.add(new MusicBean(0, "A Little Story", "Valentin-My View A Little Story", R.raw.music1));
        listData.add(new MusicBean(1, "我的名字", "焦迈奇-我的名字", R.raw.music2));
        listData.add(new MusicBean(2, "情深深雨蒙蒙", "杨胖雨-情深深 雨蒙蒙", R.raw.music3));

        ListView lvMusic = findViewById(R.id.lvMusic);
        adapter = new MusicAdapter(this, listData);
        lvMusic.setAdapter(adapter);

    }
}